package com.cppsu.cgx.libraryseatselection.services.impl;

import com.cppsu.cgx.libraryseatselection.entity.Floor;
import com.cppsu.cgx.libraryseatselection.mapper.FloorDynamicSqlSupport;
import com.cppsu.cgx.libraryseatselection.mapper.FloorMapper;
import com.cppsu.cgx.libraryseatselection.services.FloorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

import static org.mybatis.dynamic.sql.SqlBuilder.isEqualTo;

/**
 * @Author: guibo
 * @Description:
 * @Date: Created in 13:17 2021/3/12
 * @Modified By:
 */
@Service
public class FloorServiceImpl implements FloorService {
    @Autowired
    FloorMapper floorMapper;
    @Override
    public List<Floor> listByLibraryId(Long id) {
        return floorMapper.select(c->c.where(FloorDynamicSqlSupport.libraryId,isEqualTo(id)).and(FloorDynamicSqlSupport.openStatus,isEqualTo(1)));
    }
}
